import pandas as pd
df = pd.read_csv('result.csv')
df.head()
pd.set_option('display.float_format', lambda x: '%.0f' % x)
res = df.groupby('Month')[['Total']].sum()
res
4.613443e+06
ax = res.plot(kind='bar', grid=True)
ax.set_ylabel('USD (mln.)')
ax.get_yaxis().get_major_formatter().set_scientific(False)
import matplotlib.pyplot as plt
plt.bar(res.index, res.Total)
plt.xticks(range(1, 13))
plt.yticks(range(0, 5000000, 500000))
plt.gcf().axes[0].yaxis.get_major_formatter().set_scientific(False)
plt.grid()
plt.show()
plt.rcParams['figure.figsize']
plt.rcParams['figure.figsize'] = [12, 8]
plt.bar(res.index, res.Total)
plt.xticks(range(1, 13))
plt.yticks(range(0, int(round(res.max()[0])), 500000))
plt.gcf().axes[0].yaxis.get_major_formatter().set_scientific(False)
plt.xlabel('Месяцы')
plt.ylabel('Выручка в $')
for index, value in enumerate(res.Total):
plt.text(
index+1,
500000,
'{0:,}'.format(round(value)).replace(',', ' '),
rotation='vertical',
size='20',
color='#fff',
ha='center')
# plt.grid()
plt.show()
int(round(res.max()[0]))
'{0:,}'.format(round(1822256.72)).replace(',', ' ')